package com.tcc.fastline.Fragments;

import com.tcc.fastline.SessionManager;
import com.tcc.smartqueue.R;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class LoginFragment extends ConteudoFragment {

	private View _view;
	private Context context;
	
	EditText txtUsuario, txtSenha;
	TextView txtMsgAlerta;
	Button btnLogar, btnCadastrarUsuario, BtnCadastrarEstabelecimento;
	

	@Override
	public ConteudoFragment newInstance() {
		LoginFragment newForecastFragment = new LoginFragment();

		Bundle argumentsBundle = new Bundle();

		newForecastFragment.setArguments(argumentsBundle);
		return newForecastFragment; 
	}

	@Override
	public ConteudoFragment newInstance(Bundle argumentsBundle) {
		return newInstance();
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		
		View rootView = inflater.inflate(R.layout.login_fragment_main, null);

		_view = rootView.findViewById(R.id.login_fragment);
		
		txtSenha = (EditText) rootView.findViewById(R.id.editTextPasswordToLogin);
		txtUsuario = (EditText) rootView.findViewById(R.id.editTextUserNameToLogin);
		txtMsgAlerta = (TextView) rootView.findViewById(R.id.txtAlertaLogin);
		
		context = rootView.getContext(); // save the Context
		
		SessionManager.setContext(context);

		return rootView; 
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceStateBundle) {
		super.onActivityCreated(savedInstanceStateBundle);
		
		_view.setVisibility(View.VISIBLE);
		
	}
}
